import * as actionType from '../actions/actionType';

const initState = {
  isLogin: false,
  ischeckAuthComplete: false
}

export default (state = initState, action)=> {
  switch(action.type) {
    case actionType.LOGIN_SUCCESS:
      return {
        ...state,
        isLogin: true
      };
    case actionType.LOGIN_FAILED:
      return {
        ...state,
        isLogin: false
      };
    case actionType.CHECK_AUTH_COMPLETED:
      return {
        ...state,
        isCheckAuthComplete: true
      };
    default:
      return state;  
  }
}